package src.main.java.org.io;

import java.io.*;

/*
字节缓冲流
* */
public class Test9 {
    public static void main(String[] args) {
        try (
                InputStream bufferedInputStream = new BufferedInputStream(new FileInputStream("E:\\JavaLearn\\javaCode\\src\\test1.txt"));
                OutputStream bufferedOutputStream = new BufferedOutputStream(new FileOutputStream("E:\\JavaLearn\\javaCode\\src\\test4.txt"));
        ) {
            byte[] buffer = new byte[1024];
            int len;
            while((len = bufferedInputStream.read(buffer))!=-1){
                bufferedOutputStream.write(buffer,0,len);
            }
            System.out.println("复制完成");
        }catch (Exception e){
            e.printStackTrace();
        }
    }
}
